package com.lx.idgenerator.segement.leaf;

import java.util.Objects;

/**
 * @author lX
 * @version JDK 8
 * @className LeafInfo (此处以class为例)
 * @date 2024/10/28
 * @description TODO
 */
public class LeafInfo {

    /**
     * 业务标识
     */
    private String tag;

    /**
     * 当前ID
     */
    private long curId;

    /**
     * 最大ID
     */
    private Long maxId;

    /**
     * 节点描述
     */
    private String desciption;

    /**
     * 更新时间
     *
     */
    private long updateTime;

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public long getCurId() {
        return curId;
    }

    public void setCurId(long curId) {
        this.curId = curId;
    }

    public Long getMaxId() {
        return maxId;
    }

    public void setMaxId(Long maxId) {
        this.maxId = maxId;
    }

    public String getDesciption() {
        return desciption;
    }

    public void setDesciption(String desciption) {
        this.desciption = desciption;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "LeafInfo{" +
                "tag='" + tag + '\'' +
                ", curId=" + curId +
                ", maxId=" + maxId +
                ", desciption='" + desciption + '\'' +
                ", updateTime=" + updateTime +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LeafInfo leafInfo = (LeafInfo) o;
        return curId == leafInfo.curId && updateTime == leafInfo.updateTime && Objects.equals(tag, leafInfo.tag) && Objects.equals(maxId, leafInfo.maxId) && Objects.equals(desciption, leafInfo.desciption);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tag, curId, maxId, desciption, updateTime);
    }
}
